<template>
  <view>
    <view class="u-page">
      <view class="con">
        <!-- 工地选择页 -->
        <u-search placeholder="请输入关键字" v-model="keyword"></u-search>
        
        <u-radio-group
          v-model="radiovalue1"
          placement="column"
          @change="groupChange"
        >
          <u-radio
            :customStyle="{ marginBottom: '8px' }"
            v-for="(item, index) in radiolist1"
            :key="index"
            :label="item.name"
            :name="item.name"
            @change="radioChange"
          >
          </u-radio>
        </u-radio-group>

      </view>
    </view>
  </view>
</template>
<script>
import getLocation from "@/utils/getLocation.js";
import { mapState, mapMutations } from "vuex";
import sceneMixins from "@/utils/sceneMixins";
export default {
  options: { styleIsolation: "shared" },
  mixins: [getLocation, sceneMixins],
  computed: {
    ...mapState(["lnglat", "userInfo", "openId", "token", "characterType"]),
  },
  data() {
    return {
      keyword: "",
      radiovalue1:"",
      radiolist1:[]
    };
  },

  methods: {
    ...mapMutations(["changeTab", "changeCharacterType"]),
    getGds() {
      var vm = this;
      vm.getAndLoad(
        "获取工地数据",
        vm.WX_ASSETS + "/xcx/task/gd.jsp",
        function (res) {
          vm.radiolist1 = res.data;
        }
      );
    },
    groupChange(name){
        console.log(name)
    },
    radioChange(name){
        console.log(name)
    },
    back: function () {
      // #ifdef H5
      history.go(-1);
      // #endif
      // #ifdef MP
      uni.navigateBack();
      // #endif
    },
  },
  onShow() {
    var vm = this;
    vm.getGds();
  },
  onLoad(options) {},
};
</script>

<style lang="scss" scoped>
.u-page {
  height: 100vh;
  overflow: hidden;
  background: #fff;
}
.con {
  width: 90vw;
  height: 90vh;
  margin: 0 auto;
}
.h10{
    width: 100vw;
    height: 10rem;
}
</style>
